package github.sf.fw.tools.db.model;

import lombok.Data;

import java.util.List;

@Data
public class TableDataWithPage {
    private int page;
    private int size;
    private int count;
    private List<ResultRow> records;

    public TableDataWithPage(int page, int size, int count, List<ResultRow> records) {
        this.page = page;
        this.size = size;
        this.count = count;
        this.records = records;
    }

    public static TableDataWithPage of(int page, int size, int count, List<ResultRow> records) {
        return new TableDataWithPage(page, size, count, records);
    }

    public static TableDataWithPage of(int count, List<ResultRow> records) {
        return new TableDataWithPage(0, 0, count, records);
    }
}
